/*
private void IRAVP_BandHeightChanged(object sender, DevExpress.XtraReports.UI.BandEventArgs e) {
polje6rs =0;
polje7rs =0;
polje8rs =0;
polje9rs =0;
polje10rs =0;
polje11rs =0;
polje12rs =0;
polje13rs =0;
polje14rs =0;
polje15rs =0;
first = true;
}

private void IRAVP_PrintProgress(object sender, DevExpress.XtraPrinting.PrintProgressEventArgs e) {
polje6rs =0;
polje7rs =0;
polje8rs =0;
polje9rs =0;
polje10rs =0;
polje11rs =0;
polje12rs =0;
polje13rs =0;
polje14rs =0;
polje15rs =0;
first = true;
}

int prebroj=0;
Decimal polje6rs =0;
Decimal polje7rs =0;
Decimal polje8rs =0;
Decimal polje9rs =0;
Decimal polje10rs =0;
Decimal polje11rs =0;
Decimal polje12rs =0;
Decimal polje13rs =0;
Decimal polje14rs =0;
Decimal polje15rs =0;
Decimal polje6pold =0;
Decimal polje6p=0;
Decimal polje7pold =0;
Decimal polje7p=0;
Decimal polje8pold =0;
Decimal polje8p=0;
Decimal polje9pold =0;
Decimal polje9p=0;
Decimal polje10pold =0;
Decimal polje10p=0;
Decimal polje11pold =0;
Decimal polje11p=0;
Decimal polje12pold =0;
Decimal polje12p=0;
Decimal polje13pold =0;
Decimal polje13p=0;
Decimal polje14pold =0;
Decimal polje14p=0;
Decimal polje15pold =0;
Decimal polje15p=0;
private void IRAVP_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {

}

int lastid9=0;
private void xrLabel59_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
if (lastid9 != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
lastid9 = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
polje15rs += (Decimal)xr15.Summary.GetResult();
polje15pold = (polje15rs - (Decimal)xr15.Summary.GetResult())+(Decimal)polje15p;
}
   e.Result = polje15rs+(Decimal)polje15p;

if (lastpage) 
{
polje15rs = 0;

lastid9 =0;

}
    e.Handled = true;
}

bool lastpage = false;

private void xrLabel59_PrintOnPage(object sender, DevExpress.XtraReports.UI.PrintOnPageEventArgs e) {

if (e.PageIndex == e.PageCount-1)
{
lastpage = true;
}
else
{
lastpage = false;
}
}

int lastid8=0;
private void xrLabel58_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
if (lastid8 != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
lastid8 = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
polje14rs += (Decimal)xr14.Summary.GetResult();
polje14pold = (polje14rs - (Decimal)xr14.Summary.GetResult())+(Decimal)polje14p;
}
   e.Result = polje14rs+(Decimal)polje14p;

if (lastpage) 
{
polje14rs = 0;

lastid8 =0;

}
    e.Handled = true;
}

int lastid7=0;
private void xrLabel57_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) 
{
if (lastid7 != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
lastid7 = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
polje13rs += (Decimal)xr13.Summary.GetResult();
polje13pold = (polje13rs - (Decimal)xr13.Summary.GetResult())+(Decimal)polje13p;
}
   e.Result = polje13rs+(Decimal)polje13p;
if (lastpage) 
{
polje13rs = 0;

lastid7 =0;
}
    e.Handled = true;
}

int lastid6=0;
private void xrLabel56_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
if (lastid6 != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
lastid6 = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
polje12rs += (Decimal)xr12.Summary.GetResult();
polje12pold = (polje12rs - (Decimal)xr12.Summary.GetResult())+(Decimal)polje12p;
}
   e.Result = polje12rs+(Decimal)polje12p;

if (lastpage) 
{
polje12rs = 0;

lastid6 =0;
}
    e.Handled = true;
}

int lastid5=0;
private void xrLabel55_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
if (lastid5 != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
lastid5 = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
polje11rs += (Decimal)xr11.Summary.GetResult();
polje11pold = (polje11rs - (Decimal)xr11.Summary.GetResult())+(Decimal)polje11p;
}
   e.Result = polje11rs+(Decimal)polje11p;
if (lastpage) 
{
polje11rs = 0;

lastid5 =0;

}
    e.Handled = true;
}

int lastid4=0;
private void xrLabel54_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
if (lastid4 != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
lastid4 = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
polje10rs += (Decimal)xr10.Summary.GetResult();
polje10pold = (polje10rs - (Decimal)xr10.Summary.GetResult())+(Decimal)polje10p;
}
   e.Result = polje10rs+(Decimal)polje10p;
if (lastpage) 
{
polje10rs = 0;

lastid4 =0;

}
    e.Handled = true;
}

int lastid3=0;
private void xrLPrethodnaStr_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
if (lastid3 != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
lastid3 = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
polje9rs += (Decimal)xr9.Summary.GetResult();
polje9pold = (polje9rs - (Decimal)xr9.Summary.GetResult())+(Decimal)polje9p;
}

   e.Result = polje9rs+(Decimal)polje9p;


if (lastpage) 
{
polje9rs = 0;

lastid3 =0;

}
    e.Handled = true;
}

int lastid1a=0;
private void xrLabel52_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
if (lastid1a != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
lastid1a = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
polje8rs += (Decimal)xr8.Summary.GetResult();
polje8pold = (polje8rs - (Decimal)xr8.Summary.GetResult())+(Decimal)polje8p;
}
   e.Result = polje8rs+(Decimal)polje8p;

if (lastpage) 
{
polje8rs= 0;

lastid1a =0;

}
    e.Handled = true;
}

int lastid1=0;
private void xrLabel51_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
if (lastid1 != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
lastid1 = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
polje7rs += (Decimal)xr7.Summary.GetResult();
polje7pold = (polje7rs - (Decimal)xr7.Summary.GetResult())+(Decimal)polje7p;
}
   e.Result = polje7rs+(Decimal)polje7p;

if (lastpage) 
{
polje7rs = 0;

lastid1=0;

}
    e.Handled = true;
}

int lastid=0;
private void xrLabel26_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
if (lastid != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
lastid = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
polje6rs += (Decimal)xr6.Summary.GetResult();
polje6pold = (polje6rs - (Decimal)xr6.Summary.GetResult())+(Decimal)polje6p;
}
//if (lastid == pageprint6 || lastid == 0)
//{
//lastid=pageprint6;
//polje6rs += (Decimal)xr6.Summary.GetResult();
//polje6pold = (polje6rs - (Decimal)xr6.Summary.GetResult())+(Decimal)polje6p;
//}

e.Result = polje6rs +(Decimal)polje6p;
//e.Result = pageprint6;

if (lastpage) 
{
polje6rs = 0;

lastid=0;
//lastid = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
}
    e.Handled = true;
}

private void xrLabel60_PrintOnPage(object sender, DevExpress.XtraReports.UI.PrintOnPageEventArgs e) {

     if (e.PageIndex == 0)
            {

e.Cancel = true;
            }




}

int lastidtest10 =0;
private void xrLabel49_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
e.Result = null;
if (lastidtest10 ==0)
{
lastidtest10 = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
}
if (lastidtest10 != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
e.Result = polje15pold;
}

if (lastpage)
{
lastidtest10 = 0;
polje15pold = 0;
}

e.Handled = true;
}

int lastidtest9 =0;
private void xrLabel48_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
e.Result = null;
if (lastidtest9 ==0)
{
lastidtest9 = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
}
if (lastidtest9 != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
e.Result = polje14pold;
}

if (lastpage)
{
lastidtest9 = 0;
polje14pold = 0;
}

e.Handled = true;
}

int lastidtest8 =0;
private void xrLabel47_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
e.Result = null;
if (lastidtest8 ==0)
{
lastidtest8 = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
}
if (lastidtest8 != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
e.Result = polje13pold;
}

if (lastpage)
{
lastidtest8 = 0;
polje13pold = 0;
}

e.Handled = true;
}

int lastidtest7 =0;
private void xrLabel34_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
e.Result = null;
if (lastidtest7 ==0)
{
lastidtest7 = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
}
if (lastidtest7 != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
e.Result = polje12pold;
}

if (lastpage)
{
lastidtest7 = 0;
polje12pold = 0;
}

e.Handled = true;
}

int lastidtest6 =0;
private void xrLabel33_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
e.Result = null;
if (lastidtest6 ==0)
{
lastidtest6 = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
}
if (lastidtest6 != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
e.Result = polje11pold;
}

if (lastpage)
{
lastidtest6 = 0;
polje11pold = 0;
}

e.Handled = true;
}

int lastidtest5 =0;
private void xrLabel32_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
e.Result = null;
if (lastidtest5 ==0)
{
lastidtest5 = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
}
if (lastidtest5 != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
e.Result = polje10pold;
}

if (lastpage)
{
lastidtest5 = 0;
polje10pold = 0;
}

e.Handled = true;
}

int lastidtest4 =0;
private void xrLabel31_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
e.Result = null;
if (lastidtest4 ==0)
{
lastidtest4 = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
}
if (lastidtest4 != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
e.Result = polje9pold;
}

if (lastpage)
{
lastidtest4 = 0;
polje9pold = 0;
}

e.Handled = true;
}

int lastidtest3 =0;
private void xrLabel30_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
e.Result = null;
if (lastidtest3 ==0)
{
lastidtest3 = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
}
if (lastidtest3 != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
e.Result = polje8pold;
}

if (lastpage)
{
lastidtest3 = 0;
polje8pold = 0;
}

e.Handled = true;
}

int lastidtest2 =0;
private void xrLabel29_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {
e.Result = null;
if (lastidtest2 ==0)
{
lastidtest2 = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
}
if (lastidtest2 != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
e.Result = polje7pold;
}

if (lastpage)
{
lastidtest2 = 0;
polje7pold = 0;
}

e.Handled = true;
}

bool first = false;
int lastidtest=0;
private void xrLabel28_SummaryGetResult(object sender, DevExpress.XtraReports.UI.SummaryGetResultEventArgs e) {

e.Result = null;
if (lastidtest ==0)
{
lastidtest = (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
}
if (lastidtest != (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR"))))
{ 
//lastidtest= (Convert.ToInt32(DetailReport.GetCurrentColumnValue("REDBR")));
  e.Result = polje6pold;
}

if (lastpage)
{
lastidtest = 0;
polje6pold = 0;
}

e.Handled = true;
}

private void Detail2_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
if (mjesecod == 1)
{
Detail2.Visible = false;
}
}

private void xrLabel7_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
try{
polje6p = Convert.ToDecimal(DetailReport1.GetCurrentColumnValue("Iznos s porezom"));

polje7p = Convert.ToDecimal(DetailReport1.GetCurrentColumnValue("ne podlijeze oporezivanju"));
polje8p = Convert.ToDecimal(DetailReport1.GetCurrentColumnValue("osloboden poreza - izvoz"));
polje9p = Convert.ToDecimal(DetailReport1.GetCurrentColumnValue("osloboden poreza - u tuzemstvu"));
polje10p = Convert.ToDecimal(DetailReport1.GetCurrentColumnValue("osloboden poreza - ostalo"));
polje11p = Convert.ToDecimal(DetailReport1.GetCurrentColumnValue("0% - iznos"));
polje12p = Convert.ToDecimal(DetailReport1.GetCurrentColumnValue("oporezivo 10% - osnovica"));
polje13p = Convert.ToDecimal(DetailReport1.GetCurrentColumnValue("oporezivo 10% - porez"));
polje14p = Convert.ToDecimal(DetailReport1.GetCurrentColumnValue("oporezivo 22% - osnovica"));
polje15p = Convert.ToDecimal(DetailReport1.GetCurrentColumnValue("oporezivo 22% - porez"));
}
catch{
}
}

System.Int32 mjesecod = 0;
private void Detail3_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
mjesecod = (System.Int32)DetailReport2.GetCurrentColumnValue("MjesecOd");
}
*/